#ifndef __OLED_CORE_H
#define __OLED_CORE_H

#include <stdint.h>
#include <stdbool.h>
#include "bsp_i2c.h"

typedef struct
{
    bsp_i2c_bus_t i2c_bus;
    uint8_t dev_addr;      // 8bit addr
    uint8_t x_max;
    uint8_t y_max;
}oled_cfg_t;

uint8_t oled_init(void);
uint8_t oled_uninit(void);

bool oled_get_state(void);
uint8_t oled_get_x_max(void);
uint8_t oled_get_y_max(void);

uint8_t oled_open_display(void);
uint8_t oled_close_display(void);

void oled_cls(void);
void oled_clear(uint8_t x, uint8_t y, uint8_t x1, uint8_t y1);

uint8_t oled_set_pos(uint8_t x, uint8_t y);
uint8_t oled_write_data(uint8_t *data, uint16_t len);

#endif
